package me.zhengjie.modules.enrstu.service.enums;

import lombok.Getter;


@Getter
public enum ReviewResult {
    APPROVED("pass","审核通过"),
    RETURNED("back","退回初审"),
    ADMITTED("hire","录取"),
    REJECTED("fail","驳回"),
    //提交审核
    SUBMIT("submit","提交审核");



    private final String description;
    private final String result;

    ReviewResult(String result,String description) {
        this.description = description;
        this.result = result;
    }

    // 从描述字符串获取枚举值
    public static ReviewResult fromDescription(String description) {
        for (ReviewResult result : ReviewResult.values()) {
            if (result.getDescription().equals(description)) {
                return result;
            }
        }
        return null;
    }

    // 从结果字符串获取枚举值
    public static ReviewResult fromResult(String result) {
        for (ReviewResult value : ReviewResult.values()) {
            if (value.getResult().equals(result)) {
                return value;
            }
        }
        return null;
    }
}